﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/*
 * 自动展示 
 */
public class TirggerAoutoShow : MonoBehaviour
{
    public Toggle switchui_Tog;//需展示UIToggle

    void Start()
    {
        
    }
    private void OnTriggerEnter(Collider other)
    {
        //Debug.Log(other.transform.name);
        if (other.transform.name == "Camera Rig")
        {
            //Debug.Log("展示对应UI");
            switchui_Tog.isOn = true;

            if (transform.name == "立库")
            {
                UILeft.instance.DataViewChang(4);
                UIRight.instance.DataViewChang(4);
            }
        }
    }

    private void OnTriggerExit(Collider other)
    {
        //Debug.Log(other.transform.name);
        if (other.transform.name == "Camera Rig")
        {
            //Debug.Log("展示对应UI");
            switchui_Tog.isOn = false;
        }
    }
}
